package boardgamer.common.client.testing;

import android.graphics.PointF;
import android.graphics.RectF;
import boardgamer.common.client.Vector;

import static junit.framework.Assert.assertEquals;

/**
 * @author garysoed
 */
public class MoreAsserts {

  public static void assertRectFEquals(RectF expected, RectF actual) {
    assertRectFEquals("", expected, actual);
  } 
  
  public static void assertRectFEquals(String msg, RectF expected, RectF actual) {
    assertEquals(msg + "Left", expected.left, actual.left);
    assertEquals(msg + "Right", expected.right, actual.right);
    assertEquals(msg + "Top", expected.top, actual.top);
    assertEquals(msg + "Bottom", expected.bottom, actual.bottom);
  }
  
  public static void assertVectorEquals(Vector expected, Vector actual) {
    assertEquals(expected.getX(), actual.getX(), 0.000001f);
    assertEquals(expected.getY(), actual.getY(), 0.000001f);
  }
  
  public static void assertPointFEquals(PointF expected, PointF actual) {
    assertEquals(expected.x, actual.x, 0.000001f);
    assertEquals(expected.y, actual.y, 0.000001f);
  }
}
